package com.apptech.simplemediaplayerdemo;

import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;
import android.util.Log;

public class MyService extends Service {
	MediaPlayer me;

	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}

	@Override
	public void onCreate() {
		me = MediaPlayer.create(getApplicationContext(),R.raw.bade);
		me.start();
		me.setLooping(true);
		super.onCreate();
	}

	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		Log.d("in service","in service");

		me.start();
		return super.onStartCommand(intent, flags, startId);
	}

	@Override
	public void onDestroy() {
		me.stop();
		super.onDestroy();
	}
}
